package com.hzit.wepay.controller;

import com.fasterxml.jackson.databind.util.JSONPObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/wepay")
public class WepayController {

    @Autowired
    private RestTemplate restTemplate;


    String url = "https://api.mch.weixin.qq.com/v3/pay/transactions/h5";


    @RequestMapping("/H5")
    public void h5Pay(){
        //根据接口文档对接

        //1.封装json对象
        JSONPObject jsonpObject = new JSONPObject(null,null);

        //2.生成签名

        //3.发送post请求
       String rlt = restTemplate.postForObject(url,jsonpObject,String.class);


        //4.解析获得h5url


    }


}
